//
// Created by fazhehy on 2024/8/11.
//

#ifndef LEARN_H
#define LEARN_H

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "hy_common_inc.h"

#define MAX_GROUP_LEN   (24+1)
#define MAX_LAMP_NUM    (10+1)
#define MAX_SEQ_LEN     (30)

typedef struct {
    bool isMatch;
    int8_t sequence[MAX_SEQ_LEN];
}match_group_t;

extern match_group_t lampGroup[MAX_GROUP_LEN];
extern uint8_t matchGroup[MAX_GROUP_LEN];
extern uint8_t matchLen;
extern uint8_t groupLen;

void lamp_seq_init();
void set_lamp_seq(uint8_t group, uint8_t order, uint8_t num);
uint8_t search_match_group(uint8_t order, uint8_t num);
uint8_t predict_lamp_num(uint8_t order);
void add_new_sequence();

#endif //LEARN_H
